<?php
function smarty_function_catalog_info($params, &$smarty)
{
	include($_ENV['webpath']."conn.php");
	include_once($_ENV['webpath']."model/article.php");
	
	$id=$params['catalog_id'];
	if($params['mode']==2){
		$arr=get_group_catalog($id);
	}else{
		if($id){
			$sql="select * from ".$prefix."column where id=".$id;
			$result=mysql_query($sql);
			if($row=mysql_fetch_array($result)){
				$row['path']=get_catalog_path_all($row['id']);
				$arr=$row;
			}
		}
	}

	if (empty($params['assign'])) {
		return $arr;
	} else {
		$smarty->assign($params['assign'],$arr);
	}
	mysql_close($conn);
}
?>
